

OBJ=obj
SRC=src
EXE=bin
CPPFLAGS=-c -g -std=c++11 -O0
CXX=g++

SRCFILES=
OBJFILES=$(OBJ)/utilities.o \
         $(OBJ)/mergeArrays.o \
         $(OBJ)/sortString.o \
         $(OBJ)/findElem.o \
         $(OBJ)/findString.o \
         $(OBJ)/searchSortedMatrix.o \
         $(OBJ)/radixSort.o

all: testMergeArrays.exe \
     testSortString.exe \
     testFindElem.exe \
     testFindString.exe \
     testSearchMatrix.exe \
     testRadixSort.exe \
     install

testMergeArrays.exe : $(OBJ)/testMergeArrays.o $(OBJFILES)
	$(CXX) -o $@ $^

testSortString.exe : $(OBJ)/testSortString.o $(OBJFILES)
	$(CXX) -o $@ $^

testFindElem.exe : $(OBJ)/testFindElem.o $(OBJFILES)
	$(CXX) -o $@ $^

testFindString.exe : $(OBJ)/testFindString.o $(OBJFILES)
	$(CXX) -o $@ $^

testSearchMatrix.exe : $(OBJ)/testSearchMatrix.o $(OBJFILES)
	$(CXX) -o $@ $^

testRadixSort.exe : $(OBJ)/testRadixSort.o $(OBJFILES)
	$(CXX) -o $@ $^

$(OBJ)/%.o : $(SRC)/%.cpp
	$(CXX) $(CPPFLAGS) -o $@ $<

install:
	mv *.exe $(EXE)/.

clean:
	rm -rf 	$(OBJ)/*.o $(EXE)/*.exe
